package com.bidevalution.controller.api;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bidevalution.business.service.BeEvalutionColumnService;
import com.bidevalution.dao.entity.BeEvalutionColumn;
import com.bidevalution.support.util.MapUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.qtp.core.model.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/beEvalutionColumn")
@Api(tags = "自定义字段列表")
public class BeEvalutionColumnController {
	@Autowired
	private BeEvalutionColumnService beEvalutionColumnService;
	@ApiOperation(value = "自定义字段查询", notes = "自定义字段查询", response = BeEvalutionColumn.class)
	@GetMapping("/getEvalutionColumnList")
	public Response<List<Map<String, Object>>> selectList() {
		List<Map<String, Object>> dataList = Lists.newArrayList();
		for(BeEvalutionColumn beEvalutionColumn:beEvalutionColumnService.selectList()) {
			dataList.add(MapUtil.create().putValue("value", beEvalutionColumn.getColumnCode()).putValue("address", beEvalutionColumn.getColumnCode()).getMap());
		}
		return Response.ok(dataList);
	}
}
